import eMailProcessor
import runTestBase
import sys
import email

class testEMailProcessor(eMailProcessor.eMailProcessor, runTestBase.runTestBase):
    def __init__(self):
        eMailProcessor.eMailProcessor.__init__(self, './', 'FILE', True)

    def runTest1(self):
        print '                  Starts processEMails'
        print '--------------------------------------------------------'
        self.processEMails('test')
        print '                  Ends processEMails'
        print '--------------------------------------------------------'

    def runTest2(self):
        try:
            print '                  Starts stripMessage'
            print '--------------------------------------------------------'
            fp  = open('testMessage1')
            msg = email.message_from_file(fp)
            print 'Original Message'
            print '--------------------------------------------------------'
            print msg.get_payload()
            print 'Stripped Message'
            print '--------------------------------------------------------'
            print self.stripMessage(msg.get_payload())
            print '                  Ends stripMessage'
            print '--------------------------------------------------------'
        except:
            print sys.exec_info()
            print 'Error'
